﻿using Service.Repository;
using SqlSugar;

namespace Service.Auth.Domain.AggregatesModel
{
    /// <summary>
    /// 用户权限
    /// </summary>
    [SugarTable("tb_user_system_roles")]
    public class UserSystemRole : Entity
    {
        public UserSystemRole()
        {
        }

        public UserSystemRole(long systemId, long userId, long roleId, string roleNum, string systemName)
        {
            SystemId = systemId;
            UserId = userId;
            RoleId = roleId;
            RoleNum = roleNum;
            SystemName = systemName;
        }

        [SugarColumn(ColumnName = "system_id", IsPrimaryKey = true)]
        public long SystemId { get; private set; }


        [SugarColumn(ColumnName = "system_name")]
        public string SystemName { get; private set; }


        [SugarColumn(ColumnName = "user_id", IsPrimaryKey = true)]
        public long UserId { get; set; }


        [SugarColumn(ColumnName = "role_id", IsPrimaryKey = true)]
        public long RoleId { get; private set; }

        [SugarColumn(ColumnName = "role_num")]
        public string RoleNum { get; private set; }

        public void SerRoleNum(string value)
        {
            RoleNum = value;
        }
    }
}
